package com.flower.droid;





import com.flower.droid.FlowerView.FlowerThread;

import android.app.Activity;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.WindowManager;
import android.view.View.OnClickListener;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.AnimationUtils;
import android.widget.TextView;
import android.widget.ViewFlipper;

public class MainActivity extends Activity implements OnClickListener{
	
	public static MainActivity instance = null;
	
	/** A handle to the thread that's actually running the animation. */
    private FlowerThread mFlowerThread;

    /** A handle to the View in which the game is running. */
    private FlowerView mFlowerView;
	
	 @Override
	    public void onCreate(Bundle savedInstanceState) {
	        super.onCreate(savedInstanceState);
	        setContentView(R.layout.main);
	        
	        this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
	                WindowManager.LayoutParams.FLAG_FULLSCREEN );
	        
	        instance = this;
	        
	        mFlowerView = (FlowerView)findViewById(R.id.flower);
	        mFlowerThread = mFlowerView.getThread();
	        
	       mFlowerView.setTextView((TextView)findViewById(R.id.text));
	        
	    }

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		
	}
	
	
	/** Called on game resume(like lost focus) */
    @Override
    public void onResume()
    {
    	super.onResume();
    	mFlowerThread.unpause();
    }
    
    /** Game lost focus */
    @Override
    public void onPause()
    {
    	super.onPause(); //if we have errors with code under this working move this to bottom
    	mFlowerThread.pause();
    }

}
